<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png">
  <link rel="mask-icon" href="/images/favicon.png" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://codz-me.vercel.app').hostname,
    root: '/',
    scheme: 'Muse',
    version: '7.7.1',
    exturl: false,
    sidebar: {"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: true,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="Bug Not Found">
<meta property="og:type" content="website">
<meta property="og:title" content="Code Is Poetry">
<meta property="og:url" content="https://codz-me.vercel.app/page/6/index.html">
<meta property="og:site_name" content="Code Is Poetry">
<meta property="og:description" content="Bug Not Found">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="laudukang">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://codz-me.vercel.app/page/6/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: true,
    isPost: false
  };
</script>

  <title>Code Is Poetry</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Code Is Poetry</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-commonweal">

    <a href="/404/" rel="section"><i class="fa fa-fw fa-heartbeat"></i>公益 404</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/06/04/web-performance-test-tool-gor/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/06/04/web-performance-test-tool-gor/" class="post-title-link" itemprop="url">终极 Web 应用性能和压力测试工具 Gor</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-06-04 23:31:21 23:31:21" itemprop="dateModified" datetime="2015-06-04T23:31:21+08:00">2015-06-04 23:31:21</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Web/" itemprop="url" rel="index">
                    <span itemprop="name">Web</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/06/04/web-performance-test-tool-gor/" class="post-meta-item leancloud_visitors" data-flag-title="终极 Web 应用性能和压力测试工具 Gor" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h2 id="常见的-Web-应用的压力测试工具"><a href="#常见的-Web-应用的压力测试工具" class="headerlink" title="常见的 Web 应用的压力测试工具"></a>常见的 Web 应用的压力测试工具</h2><p>Web 应用压力测试工具有很多，比如 Apache ab，node-ab，Apache JMeter, LoadRunner, httperf。但是这些工具都没能解决一个问题：</p>
<h2 id="如何正确模拟生产环境的流量"><a href="#如何正确模拟生产环境的流量" class="headerlink" title="如何正确模拟生产环境的流量"></a>如何正确模拟生产环境的流量</h2><p>如今 Web 应用的架构变得非常复杂，内部包含复杂的各种负载均衡、 服务和 RPC 调用关系，简单的发送 GET 请求到某些 URL 或者 API 接口完全无法模拟真实的流量。假如回放 HTTP 日志，操作又异常麻烦。Tcpcopy 虽然能够复制实时流量，但是操作也很复杂。之前的 亚马逊云平台的迁移 就用到了 Gor 这个工具。</p>
<h2 id="Gor-是-Web-应用压力测试的完美方案"><a href="#Gor-是-Web-应用压力测试的完美方案" class="headerlink" title="Gor 是 Web 应用压力测试的完美方案"></a>Gor 是 Web 应用压力测试的完美方案</h2><p>我一直在找一个简单又方便的解决方案，直到找到了 Gor 。Gor 是用 Golang 写的一个 HTTP 实时流量复制工具。只需要在 LB 或者 Varnish 入口服务器上执行一个进程，就可以把生产环境的流量复制到任何地方，比如 Staging 环境、Dev 环境。完美解决了 HTTP 层实时流量复制和压力测试的问题。</p>
<h2 id="Gor-的功能"><a href="#Gor-的功能" class="headerlink" title="Gor 的功能"></a>Gor 的功能</h2><p>Gor 支持流量的放大和缩小、频率限制，这样不需要搭建和生产环境一致的服务器集群也可以正确测试。Gor 还支持根据正则表达式过滤流量，这意味着可以单独测试某个 API 服务。还可以修改 HTTP 请求头，比如替换 User-Agent, 或者增加某些 HTTP Header 。</p>
<p>Gor 还可以把请求记录到文件，以备回放和分析。Gor 支持和 ElasticSearch 集成，将流量存入 ES 进行实时分析。</p>
<h2 id="Gor-的常用命令"><a href="#Gor-的常用命令" class="headerlink" title="Gor 的常用命令"></a>Gor 的常用命令</h2><p>简单的 HTTP 流量复制：</p>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –input-<span class="string">raw :</span><span class="number">80</span> –output-http “<span class="string">http:</span><span class="comment">//staging.com”</span></span><br></pre></td></tr></table></figure>
<p>HTTP 流量复制频率控制：</p>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –input-<span class="string">tcp :</span><span class="number">28020</span> –output-http “<span class="string">http:</span><span class="comment">//staging.com|10″</span></span><br></pre></td></tr></table></figure>
<p>HTTP 流量复制缩小：</p>
<figure class="highlight angelscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –input-raw :<span class="number">80</span> –output-tcp “replay.local:<span class="number">28020</span>|<span class="number">10</span>%”</span><br></pre></td></tr></table></figure>
<p>HTTP 流量记录到本地文件：</p>
<figure class="highlight sas"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –<span class="meta">input</span>-raw :80 –<span class="meta">output</span>-<span class="meta">file</span> requests.gor</span><br></pre></td></tr></table></figure>
<p>HTTP 流量回放和压测：</p>
<figure class="highlight sas"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –<span class="meta">input</span>-<span class="meta">file</span> “requests.gor|200%” –<span class="meta">output</span>-http “staging.com”</span><br></pre></td></tr></table></figure>
<p>HTTP 流量过滤复制：</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gor –<span class="built_in">input</span>-raw :<span class="number">8080</span> –<span class="built_in">output</span>-http staging.com –<span class="built_in">output</span>-http-url-regexp ^www.</span><br></pre></td></tr></table></figure>

<p>最后</p>
<p>这个 Golang 写的 Gor 是开源的，意味着可以方便的集成到自己的架构中，可以用在压力测试平台、实时流量分析、应用层防火墙等等方面。</p>
<p>reference:</p>
<ul>
<li><a href="http://blog.eood.cn/web-performance-testing-gor" target="_blank" rel="noopener">终极 Web 应用性能和压力测试工具 Gor</a></li>
<li><a href="https://github.com/buger/gor" target="_blank" rel="noopener">https://github.com/buger/gor</a></li>
<li><a href="[https://github.com/doubaokun/node-ab">https://github.com/doubaokun/node-ab</a></li>
<li><a href="https://github.com/session-replay-tools/tcpcopy" target="_blank" rel="noopener">https://github.com/session-replay-tools/tcpcopy</a></li>
<li><a href="https://github.com/httperf/httperf" target="_blank" rel="noopener">https://github.com/httperf/httperf</a></li>
<li><a href="https://github.com/buger/gor/blob/master/ELASTICSEARCH.md" target="_blank" rel="noopener">https://github.com/buger/gor/blob/master/ELASTICSEARCH.md</a></li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/" class="post-title-link" itemprop="url">[转]在 Sublime Text 里有助编码的简单视觉改善</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-08-14 16:57:54 16:57:54" itemprop="dateModified" datetime="2015-08-14T16:57:54+08:00">2015-08-14 16:57:54</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/uncategorized/" itemprop="url" rel="index">
                    <span itemprop="name">uncategorized</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/" class="post-meta-item leancloud_visitors" data-flag-title="[转]在 Sublime Text 里有助编码的简单视觉改善" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Sublime Text提供了大量的衍生功能和设置，使它满足每个人的不同需求。现在，我将向你介绍一些设置，插件，主题和配色方案来帮助你体验视觉更优化的编码。</p>
<p>它不仅仅使你的屏幕变漂亮，而且也让你成为更好的编码员！</p>
<h2 id="设置"><a href="#设置" class="headerlink" title="设置"></a>设置</h2><p>Sublime Text自带一些不错的功能，从视觉上改善你的编码体验，但是，有一些在默认状态下并未开启。下列是一些我不能没有的功能。</p>
<p>注意：为了能编辑你的Sublime Text设置文件，从<code>Sublime Text 2&gt; Preferences &gt; Settings - Default</code>中打开它并选择合适项。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-settings.png" alt="sublime-settings.png" title="">

<p>找到你想要改的设置，之后把它加到你的User Settings来避免在更新Sublime Text的时候被覆盖。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-settings-2.png" alt="sublime-settings-2.png" title="">

<p>看一下Installation and Base Settings这篇文章来了解更多如何管理Sublime Text的设置。</p>
<h3 id="字体和间隔"><a href="#字体和间隔" class="headerlink" title="字体和间隔"></a>字体和间隔</h3><p>选对字体和间隔最能使你的编码私人化。首先选择一个合适的字体，最好是monospaced font。这些可以仔细看看：</p>
<ul>
<li>Source Code Pro</li>
<li>Consolas</li>
<li>Monaco</li>
<li>Inconsolata</li>
<li>Anonymous Pro</li>
</ul>
<p>在选择了字体之后，确保它已经装在了你的系统里，把它加到设置中，然后调整大小和间隔：</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">“font_face”:</span> <span class="string">“Inconsolata";</span></span><br><span class="line"><span class="attr">"font_size":</span> <span class="number">18</span><span class="string">;</span></span><br><span class="line"><span class="attr">"line_padding_bottom":</span> <span class="number">1</span><span class="string">,</span></span><br><span class="line"><span class="attr">"line_padding_top":</span> <span class="number">1</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h3 id="highlight-line"><a href="#highlight-line" class="headerlink" title="highlight_line"></a>highlight_line</h3><p>这个设置会在鼠标停留的行上画上不同颜色的线（这个决定于你的配色方案）。看到你当前所在行能够使你在输入的同时，集中在目前的任务，更方面行与行之间的转换，而且当你从其它程序中切换回来的时候，你可以更快的找到所在点。</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">"highlight_line":</span> <span class="literal">true</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h2 id="highlight-modified-tabs"><a href="#highlight-modified-tabs" class="headerlink" title="highlight_modified_tabs"></a>highlight_modified_tabs</h2><p>为了给当前项目中没有存档的文件更多注意力，这项设置会标注出一个窗口里修改过的文件。</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">"highlight_modified_tabs":</span> <span class="literal">true</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h3 id="fade-fold-buttons"><a href="#fade-fold-buttons" class="headerlink" title="fade_fold_buttons"></a>fade_fold_buttons</h3><p>你知道Sublime Text可以闭合和展开编码段，但是我常常会忘记这项可用。如果你开启这项设置，它会把folding标签放在右边而不是隐藏起来。</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">"fade_fold_buttons":</span> <span class="literal">false</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h3 id="word-wrap"><a href="#word-wrap" class="headerlink" title="word_wrap"></a>word_wrap</h3><p>水平滚动非常让人头疼。激活这项文字换行功能，你的文字就会根据你当前的屏幕大小排布，从而防止水平滚动。</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">"word_wrap":</span> <span class="literal">true</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h3 id="bold-folder-labels"><a href="#bold-folder-labels" class="headerlink" title="bold_folder_labels"></a>bold_folder_labels</h3><p>还有很多可用的不错设置来使你的侧栏看上去更美观，它们是：</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">"bold_folder_labels":</span> <span class="literal">true</span><span class="string">,</span></span><br></pre></td></tr></table></figure>

<h3 id="在侧栏中显示打开的文件"><a href="#在侧栏中显示打开的文件" class="headerlink" title="在侧栏中显示打开的文件"></a>在侧栏中显示打开的文件</h3><p>奇怪的是，这项没有在自定义文件中设置好。为了在你的侧栏上端显示打开的文件，去：</p>
<figure class="highlight gauss"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">View</span> → Side <span class="built_in">Bar</span> → <span class="keyword">Show</span> <span class="keyword">Open</span> Files</span><br></pre></td></tr></table></figure>

<h3 id="对齐侧栏"><a href="#对齐侧栏" class="headerlink" title="对齐侧栏"></a>对齐侧栏</h3><p>这个不打算一个设置，更多的是算一个技巧。就像表格一样，你可以双击内容栏和侧栏之间的边框来使你的侧栏与内容齐宽。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-visual-sidebar.gif" alt="sublime-visual-sidebar.gif" title="">



<h2 id="插件"><a href="#插件" class="headerlink" title="插件"></a>插件</h2><p>要用到Sublime Text更多功能的时候，插件是非常有用的，我强烈推荐用Package Control来管理你的插件</p>
<h3 id="BracketHighlighter"><a href="#BracketHighlighter" class="headerlink" title="BracketHighlighter"></a>BracketHighlighter</h3><p>Bracket highlighter是一个可以标注出标签和括号的插件（去琢磨一下！）但是真的，这个工具给你显示出你所在编码段的始末。在侧栏显示的括号类型由不同的符号代表。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-visual-brackethighlighter-2.png" alt="sublime-visual-brackethighlighter-2.png" title="">

<h3 id="Git-Gutter"><a href="#Git-Gutter" class="headerlink" title="Git Gutter"></a>Git Gutter</h3><p>这个是我个人最爱。这个插件在侧边显示相较与你的git项目，哪些是新插入的，更改过的或是删除的行。Git gutter</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-visual-gitgutter-2.png" alt="sublime-visual-gitgutter-2.png" title="">

<h3 id="SublimeLinter"><a href="#SublimeLinter" class="headerlink" title="SublimeLinter"></a>SublimeLinter</h3><p>这个插件显示出嵌入式的lint标注。它们的extensive documentation和长串的linters使其成为了一个很棒的，让你编码无错误的解决方案。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-visual-sublimelinter-2.png" alt="sublime-visual-sublimelinter-2.png" title="">



<h2 id="主题和配色方案"><a href="#主题和配色方案" class="headerlink" title="主题和配色方案"></a>主题和配色方案</h2><p>最有效的私人化Sublime Text的方法是用主题和配色方案。现在有不计其数的选择而且每周都有更新。这些是可以认真看一下的主题和配色方案</p>
<h3 id="主题：Soda"><a href="#主题：Soda" class="headerlink" title="主题：Soda"></a>主题：Soda</h3><p>Soda变成了Sublime Text社区里最受欢迎的主题。很多主题都是在它之上开发的。Soda提供了额外的设置，retina图像，以及暗色和亮色的用户界面。</p>
<img src="/2015/06/04/simple-visual-enhancements-for-better-coding-in-sublime-text/sublime-visual-soda-2.png" alt="sublime-visual-soda-2.png" title="">

<h3 id="主题：Flatland"><a href="#主题：Flatland" class="headerlink" title="主题：Flatland"></a>主题：Flatland</h3><p>如果你是扁平式潮流的粉丝，那么Flatland是一个不错的选择。它简化了所有的视觉元素，而且让你指定一些其它选项，譬如</p>
<h3 id="主题：Spacegray"><a href="#主题：Spacegray" class="headerlink" title="主题：Spacegray"></a>主题：Spacegray</h3><p>这个是我个人最喜欢的也是现在Github比较火的。 Spacegray有独特的色彩盘和极简化的UI。</p>


<h3 id="色彩主题：-Solarized"><a href="#色彩主题：-Solarized" class="headerlink" title="色彩主题： Solarized"></a>色彩主题： Solarized</h3><p>这个有名的Solarized project在Sublime Text上也可用了。它被贴上“为人机设计的精确颜色”的标签，并且其创作背后有一套独特的色彩理论支持。</p>
<h3 id="色彩主题：-Base16"><a href="#色彩主题：-Base16" class="headerlink" title="色彩主题： Base16"></a>色彩主题： Base16</h3><p>Base16 is another popular color scheme with many options (I’m currently using it).Base16是另一个受欢迎的多选项的色彩主题（我现在正在用）。</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>还有很多要讲的！不要忘了，对所有Sublime Text的不同元素做一个评价是很重要的。不可全照我的话做，去Github 或者 Package Control里，尝试新的设置看它是否适合你。</p>
<p>时不时的浏览你的设置可以改善你的编码体验。</p>
<p>有什么设置，字体，插件，主题或是配色方案帮到你了吗？在评论处与你觉得有所需的人分享一下吧！</p>
<p>reference:</p>
<ul>
<li><a href="https://webdesign.tutsplus.com/zh-hans/articles/simple-visual-enhancements-for-better-coding-in-sublime-text--webdesign-18052" target="_blank" rel="noopener">在Sublime Text里有助编码的简单视觉改善</a></li>
<li><a href="https://webdesign.tutsplus.com/articles/simple-visual-enhancements-for-better-coding-in-sublime-text--webdesign-18052?ec_unit=translation-info-language" target="_blank" rel="noopener">Simple Visual Enhancements for Better Coding in Sublime Text</a></li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/06/03/building-gtk-plus-on-unix-like-systems/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/06/03/building-gtk-plus-on-unix-like-systems/" class="post-title-link" itemprop="url">Building GTK+ on UNIX-like systems</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-06-03 22:44:26 22:44:26" itemprop="dateModified" datetime="2015-06-03T22:44:26+08:00">2015-06-03 22:44:26</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index">
                    <span itemprop="name">Linux</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/06/03/building-gtk-plus-on-unix-like-systems/" class="post-meta-item leancloud_visitors" data-flag-title="Building GTK+ on UNIX-like systems" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Compiling the GTK+ libraries<br>Compiling the GTK+ Libraries — How to compile GTK+ itself<br>Building GTK+ on UNIX-like systems<br><a href="https://developer.gnome.org/gtk3/stable/gtk-building.html" target="_blank" rel="noopener">https://developer.gnome.org/gtk3/stable/gtk-building.html</a></p>
<p>gtk+3.0的环境配置及基于gtk+3.0的python简单例子<br><a href="http://blog.csdn.net/yygydjkthh/article/details/34468521" target="_blank" rel="noopener">http://blog.csdn.net/yygydjkthh/article/details/34468521</a></p>
<p>GNOME 开发者中心<br><a href="https://developer.gnome.org/" target="_blank" rel="noopener">https://developer.gnome.org/</a></p>
<p>Ubuntu + Gnome3，窗口组件背景变黑色？<br><a href="http://www.v2ex.com/t/152728" target="_blank" rel="noopener">http://www.v2ex.com/t/152728</a></p>
<p>Ubuntu下安装GTK<br><a href="http://blog.csdn.net/arnoldlu/article/details/17281499" target="_blank" rel="noopener">http://blog.csdn.net/arnoldlu/article/details/17281499</a></p>
<p>Ubuntu 14.04的系统，我想在电脑上安装GTK3.0<br><a href="http://tieba.baidu.com/p/3555958351" target="_blank" rel="noopener">http://tieba.baidu.com/p/3555958351</a></p>
<p>Ubuntu下GTK的安装、编译和测试<br><a href="http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html" target="_blank" rel="noopener">http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/27/gitlab-setup-and-svn2git/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/27/gitlab-setup-and-svn2git/" class="post-title-link" itemprop="url">GitLab 搭建及 svn2git 保留原提交记录</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2016-01-23 19:29:23 19:29:23" itemprop="dateModified" datetime="2016-01-23T19:29:23+08:00">2016-01-23 19:29:23</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Git/" itemprop="url" rel="index">
                    <span itemprop="name">Git</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/27/gitlab-setup-and-svn2git/" class="post-meta-item leancloud_visitors" data-flag-title="GitLab 搭建及 svn2git 保留原提交记录" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>背景：在学校做的项目都是使用SVN版本管理，遂研究了如何本地搭建GitLab，并且成功搭建在306实验室。laudukang，2017年11月20日14:01:53。</p>
<ul>
<li><p><a href="http://www.cnblogs.com/wintersun/p/3930900.html" target="_blank" rel="noopener">GitLab版本管理部署-推荐</a></p>
</li>
<li><p><a href="https://bitnami.com/stack/gitlab/installer" target="_blank" rel="noopener">GitLab Installers-快速安装包</a></p>
</li>
<li><p><a href="http://segmentfault.com/a/1190000000345686" target="_blank" rel="noopener">GitLab搭建自己的私有GitHub</a></p>
</li>
<li><p><a href="http://stackoverflow.com/questions/19456129/how-to-change-url-of-a-working-gitlab-install" target="_blank" rel="noopener">How to change URL of a working GitLab install?</a></p>
</li>
<li><p><a href="http://herry2013git.blog.163.com/blog/static/219568011201341111240751" target="_blank" rel="noopener">gitlab多人协同工作-推荐</a></p>
</li>
<li><p><a href="http://my.oschina.net/u/1158620/blog/289191" target="_blank" rel="noopener">Gitlab7.0通知邮箱的配置（smtp）</a></p>
</li>
<li><p><a href="http://my.oschina.net/anylain/blog/220774" target="_blank" rel="noopener">配置GitLab 用smtp发邮件 (gitlab-6.7.3)</a></p>
</li>
<li><p><a href="http://blog.fizyk.net.pl/blog/configure-gitlab-with-smtp-mail-server.html" target="_blank" rel="noopener">Configure gitlab with smtp mail server</a></p>
</li>
</ul>
<h2 id="svn2git"><a href="#svn2git" class="headerlink" title="svn2git"></a>svn2git</h2><h5 id="updated-by-laudukang-at-2017-11-20-14-10-57"><a href="#updated-by-laudukang-at-2017-11-20-14-10-57" class="headerlink" title="updated by laudukang at 2017-11-20 14:10:57"></a>updated by laudukang at 2017-11-20 14:10:57</h5><figure class="highlight jboss-cli"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">cd</span> svn_repertory</span><br><span class="line"><span class="comment">#generate author.txt config</span></span><br><span class="line">svn log <span class="params">--quiet</span>   | grep -a -E <span class="string">"r[0-9]+ \| .+ \|"</span> | cut -d'|' -f2 | sed 's/^ <span class="string">//</span>' | sort | uniq</span><br><span class="line"></span><br><span class="line">git svn clone &lt;your-svn-url&gt; <span class="params">--trunk=</span><span class="string">"trunk"</span> <span class="params">--branches=</span><span class="string">"branches"</span> -A <span class="string">/d/author.txt</span> <span class="params">--follow-parent</span> <span class="params">--username</span> laudukang <span class="params">(--password &lt;your-password&gt; 可选)</span></span><br><span class="line"></span><br><span class="line">git branch -r</span><br><span class="line">git checkout -b master remotes/your-branch</span><br><span class="line"></span><br><span class="line">git push -u origin <span class="params">--all</span> &amp;&amp; git push -u origin <span class="params">--tags</span></span><br></pre></td></tr></table></figure>

<p>reference:</p>
<ol>
<li><a href="https://www.troyhunt.com/migrating-from-subversion-to-git-with/" target="_blank" rel="noopener">Migrating from Subversion to Git with svn2git on Windows</a></li>
<li><a href="https://docs.gitlab.com/ce/user/project/import/svn.html" target="_blank" rel="noopener">Migrating from SVN to GitLab</a></li>
<li><a href="https://www.getdonedone.com/converting-5-year-old-repository-subversion-git/" target="_blank" rel="noopener">Converting A 5-Year-Old Repository From Subversion To Git</a></li>
<li><a href="https://stackoverflow.com/questions/3239759/checkout-remote-branch-using-git-svn" target="_blank" rel="noopener">Checkout remote branch using git svn</a></li>
<li><a href="https://stackoverflow.com/questions/12161541/work-around-for-failing-git-svn-clone-requiring-full-history" target="_blank" rel="noopener">Work-around for failing “git svn clone” (requiring full history)</a></li>
<li><a href="https://git-scm.com/docs/git-svn" target="_blank" rel="noopener">git-svn</a></li>
</ol>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/27/ubuntu-expand-hard-disk/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/27/ubuntu-expand-hard-disk/" class="post-title-link" itemprop="url">Ubuntu 扩展硬盘/交换分区</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-27 21:04:59 21:04:59" itemprop="dateModified" datetime="2015-05-27T21:04:59+08:00">2015-05-27 21:04:59</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index">
                    <span itemprop="name">Linux</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/27/ubuntu-expand-hard-disk/" class="post-meta-item leancloud_visitors" data-flag-title="Ubuntu 扩展硬盘/交换分区" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>背景：调整VMware虚拟机硬盘大小。laudukang。2017年11月20日14:02:38。</p>
<figure class="highlight properties"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">sudo</span> <span class="string">fdisk -l</span></span><br><span class="line"><span class="attr">sudo</span> <span class="string">fdisk /dev/sda</span></span><br></pre></td></tr></table></figure>

<ul>
<li><p><a href="http://www.linuxidc.com/Linux/2010-06/26689.htm" target="_blank" rel="noopener">Ubuntu用gparted合并分区</a></p>
</li>
<li><p><a href="http://www.2cto.com/os/201305/212230.html" target="_blank" rel="noopener">Ubuntu无损分区调整</a></p>
</li>
<li><p><a href="https://help.ubuntu.com/community/Fstab" target="_blank" rel="noopener">Introduction to fstab</a></p>
</li>
<li><p><a href="http://forum.ubuntu.org.cn/viewtopic.php?t=395230" target="_blank" rel="noopener">ubuntu取消开机出现的grub</a></p>
</li>
<li><p><a href="http://www.cnblogs.com/dutlei/archive/2012/11/20/2778327.html" target="_blank" rel="noopener">Ubuntu完全教程，让你成为Ubuntu高手</a></p>
</li>
<li><p><a href="http://blog.sina.com.cn/s/blog_7deb436e0101nzkq.html" target="_blank" rel="noopener">多系统启动出现grub rescue模式，错误“normal.mod not found”解决办法</a></p>
<p>第一步：<br>在liveCD模式进入UBUNTU，插入光盘，选择try ubuntu就是。<br>第二步：<br>安装Boot-Repair<br>先联网，然后打开终端，输入如下命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo add-apt-repository ppa:yannubuntu/boot-repair &amp;&amp; sudo apt-get update</span><br><span class="line">sudo apt-get install -y boot-repair &amp;&amp; boot-repair</span><br></pre></td></tr></table></figure>
<p>第三步：<br>修复就是了，真是好简单</p>
<img src="/2015/05/27/ubuntu-expand-hard-disk/repair-the-boot-of-the-computer.png" alt="repair the boot of the-computer" title="repair the boot of the-computer">
</li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/20/11-linux-terminal-commands-that-will-rock-your-world/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/20/11-linux-terminal-commands-that-will-rock-your-world/" class="post-title-link" itemprop="url">[转]11 Linux Terminal Commands That Will Rock Your World</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-20 10:19:20 10:19:20" itemprop="dateModified" datetime="2015-05-20T10:19:20+08:00">2015-05-20 10:19:20</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index">
                    <span itemprop="name">Linux</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/20/11-linux-terminal-commands-that-will-rock-your-world/" class="post-meta-item leancloud_visitors" data-flag-title="[转]11 Linux Terminal Commands That Will Rock Your World" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>我已经用了十年的Linux了，通过今天这篇文章我将向大家展示一系列的命令、工具和技巧，我希望一开始就有人告诉我这些，而不是曾在我成长道路上绊住我。</p>
<ol>
<li><p>命令行日常系快捷键</p>
<p>如下的快捷方式非常有用，能够极大的提升你的工作效率：</p>
<figure class="highlight properties"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">CTRL</span> <span class="string">+ U - 剪切光标前的内容</span></span><br><span class="line"><span class="attr">CTRL</span> <span class="string">+ K - 剪切光标至行末的内容</span></span><br><span class="line"><span class="attr">CTRL</span> <span class="string">+ Y - 粘贴</span></span><br><span class="line"><span class="attr">CTRL</span> <span class="string">+ E - 移动光标到行末</span></span><br><span class="line"><span class="attr">CTRL</span> <span class="string">+ A - 移动光标到行首</span></span><br><span class="line"><span class="attr">ALT</span> <span class="string">+ F - 跳向下一个空格</span></span><br><span class="line"><span class="attr">ALT</span> <span class="string">+ B - 跳回上一个空格</span></span><br><span class="line"><span class="attr">ALT</span> <span class="string">+ Backspace - 删除前一个单词</span></span><br><span class="line"><span class="attr">CTRL</span> <span class="string">+ W - 剪切光标前一个单词</span></span><br><span class="line"><span class="attr">Shift</span> <span class="string">+ Insert - 向终端内粘贴文本</span></span><br></pre></td></tr></table></figure>
<p>那么为了让上述内容更易理解来看下面的这行命令。</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-<span class="builtin-name">get</span> intall programname</span><br></pre></td></tr></table></figure>
<p>如你所见，命令中存在拼写错误，为了正常执行需要把“intall”替换成“install”。</p>
<p>想象现在光标正在行末，我们有很多的方法将她退回单词install并替换它。</p>
<p>我可以按两次ALT+B这样光标就会在如下的位置（这里用指代光标的位置）。</p>
<figure class="highlight actionscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-<span class="keyword">get</span>^intall programname</span><br></pre></td></tr></table></figure>
<p>现在你可以按两下方向键并将“s”插入到install中去了。</p>
<p>如果你想将浏览器中的文本复制到终端，可以使用快捷键”shift + insert”。</p>
</li>
<li><p>SUDO !!</p>
<p>如果你还不知道这个命令，我觉得你应该好好感谢我，因为如果你不知道的话，那每次你在输入长串命令后看到“permission denied”后一定会痛苦不堪。</p>
<ul>
<li>sudo !!</li>
</ul>
<p>如何使用sudo !!？很简单。试想你刚输入了如下命令：</p>
<figure class="highlight pgsql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt-<span class="keyword">get</span> install ranger</span><br></pre></td></tr></table></figure>
<p>一定会出现“Permission denied”，除非你已经登录了足够高权限的账户。</p>
<p>sudo !! 就会用 sudo 的形式运行上一条命令。所以上一条命令就变成了这样：</p>
<figure class="highlight pgsql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-<span class="keyword">get</span> install ranger</span><br></pre></td></tr></table></figure>
<p>如果你不知道什么是sudo，戳这里。</p>
<p>（警告！主页君强烈反对使用这个命令，因为如果万一上个命令存在一些笔误或者你搞错了哪条是上一条命令，那么有可能带来的后果是灾难性的！所以，千万不要执行这条命令！千万不要执行这条命令！千万不要执行这条命令！重要的事情重复三遍。）</p>
</li>
<li><p>暂停并在后台运行命令</p>
<p>我曾经写过一篇如何在终端后台运行命令的指南。</p>
<p>CTRL + Z - 暂停应用程序<br>fg - 重新将程序唤到前台<br>如何使用这个技巧呢?</p>
<p>试想你正用nano编辑一个文件：</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">sudo</span> <span class="selector-tag">nano</span> <span class="selector-tag">abc</span><span class="selector-class">.txt</span></span><br></pre></td></tr></table></figure>
<p>文件编辑到一半你意识到你需要马上在终端输入些命令，但是nano在前台运行让你不能输入。</p>
<p>你可能觉得唯一的方法就是保存文件，退出 nano，运行命令以后在重新打开nano。</p>
<p>其实你只要按CTRL + Z，前台的命令就会暂停，画面就切回到命令行了。然后你就能运行你想要运行命令，等命令运行完后在终端窗口输入“fg”就可以回到先前暂停的任务。</p>
<p>有一个尝试非常有趣就是用nano打开文件，输入一些东西然后暂停会话。再用nano打开另一个文件，输入一些什么后再暂停会话。如果你输入“fg”你将回到第二个用nano打开的文件。只有退出nano再输入“fg”，你才会回到第一个用nano打开的文件。</p>
</li>
<li><p>使用nohup在登出SSH会话后仍运行命令</p>
<p>如果你用ssh登录别的机器时，nohup命令真的非常有用。</p>
<p>那么怎么使用nohup呢？</p>
<p>想象一下你使用ssh远程登录到另一台电脑上，你运行了一条非常耗时的命令然后退出了ssh会话，不过命令仍在执行。而nohup可以将这一场景变成现实。</p>
<p>举个例子，因为测试的需要，我用我的树莓派来下载发行版。我绝对不会给我的树莓派外接显示器、键盘或鼠标。</p>
<p>一般我总是用SSH从笔记本电脑连接到树莓派。如果我在不用nohup的情况下使用树莓派下载大型文件，那我就必须等待到下载完成后，才能登出ssh会话关掉笔记本。可如果是这样，那我为什么要使用树莓派下文件呢？</p>
<p>使用nohup的方法也很简单，只需如下例中在nohup后输入要执行的命令即可：</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nohup wget http:<span class="regexp">//mi</span>rror.is.co.za<span class="regexp">/mirrors/</span>linuxmint.com<span class="regexp">/iso/</span><span class="regexp">/stable/</span><span class="number">17.1</span><span class="regexp">/linuxmint-17.1-cinnamon-64bit.iso &amp;</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>‘在（at）’特定的时间运行Linux命令</p>
<p>‘nohup’命令在你用SSH连接到服务器，并在上面保持执行SSH登出前任务的时候十分有用。</p>
<p>想一下如果你需要在特定的时间执行相同的命令，这种情况该怎么办呢？</p>
<p>命令‘at’就能妥善解决这一情况。以下是‘at’使用示例。</p>
<figure class="highlight ada"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">at</span> <span class="number">10</span>:<span class="number">38</span> PM Fri</span><br><span class="line"><span class="keyword">at</span>&gt; cowsay <span class="symbol">'hello</span>'</span><br><span class="line"><span class="keyword">at</span>&gt; CTRL + D</span><br></pre></td></tr></table></figure>
<p>上面的命令能在周五下午10时38分运行程序cowsay。</p>
<p>使用的语法就是‘at’后追加日期时间。当at&gt;提示符出现后就可以输入你想在那个时间运行的命令了。</p>
<p>CTRL + D 返回终端。</p>
<p>还有许多日期和时间的格式，都需要你好好翻一翻‘at’的man手册来找到更多的使用方式。</p>
</li>
<li><p>Man手册</p>
<p>Man手册会为你列出命令和参数的使用大纲，教你如何使用她们。Man手册看起来沉闷呆板。（我思忖她们也不是被设计来娱乐我们的）。</p>
<p>不过这不代表你不能做些什么来使她们变得漂亮些。</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="builtin-name">export</span> <span class="attribute">PAGER</span>=most</span><br></pre></td></tr></table></figure>
<p>你需要安装 ‘most’；她会使你的你的man手册的色彩更加绚丽。</p>
<p>你可以用以下命令给man手册设定指定的行长：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="builtin-name">export</span> <span class="attribute">MANWIDTH</span>=80</span><br></pre></td></tr></table></figure>
<p>最后，如果你有一个可用的浏览器，你可以使用-H在默认浏览器中打开任意的man页。</p>
<figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">man -H &lt;<span class="keyword">command</span>&gt;</span><br></pre></td></tr></table></figure>
<p>注意啦，以上的命令只有在你将默认的浏览器设置到环境变量$BROWSER中了之后才效果哟。</p>
</li>
<li><p>使用htop查看和管理进程</p>
<p>你用哪个命令找出电脑上正在运行的进程的呢？我敢打赌是‘ps’并在其后加不同的参数来得到你所想要的不同输出。</p>
<p>安装‘htop’吧！绝对让你相见恨晚。</p>
<p>htop在终端中将进程以列表的方式呈现，有点类似于Windows中的任务管理器。你可以使用功能键的组合来切换排列的方式和展示出来的项。你也可以在htop中直接杀死进程。</p>
<p>在终端中简单的输入htop即可运行。</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">htop</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>使用ranger浏览文件系统</p>
<p>如果说htop是命令行进程控制的好帮手，那么ranger就是命令行浏览文件系统的好帮手。</p>
<p>你在用之前可能需要先安装，不过一旦安装了以后就可以在命令行输入以下命令启动她：</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">ranger</span></span><br></pre></td></tr></table></figure>
<p>在命令行窗口中ranger和一些别的文件管理器很像，但是相比上下结构布局，她是左右结构的，这意味着你按左方向键你将前进到上一个文件夹，而右方向键则会切换到下一个。</p>
<p>在使用前ranger的man手册还是值得一读的，这样你就可以用快捷键操作ranger了。</p>
</li>
<li><p>取消关机</p>
<p>无论是在命令行还是图形用户界面关机后，才发现自己不是真的想要关机。</p>
<figure class="highlight arduino"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">shutdown</span> -c</span><br></pre></td></tr></table></figure>
<p>需要注意的是，如果关机已经开始则有可能来不及停止关机。</p>
<p>以下是另一个可以尝试命令：</p>
<figure class="highlight arduino"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pkill <span class="built_in">shutdown</span></span><br></pre></td></tr></table></figure></li>
<li><p>杀死挂起进程的简单方法</p>
<p>想象一下，你正在运行的应用程序不明原因的僵死了。</p>
<p>你可以使用‘ps -ef’来找到该进程后杀掉或者使用‘htop’。</p>
<p>有一个更快、更容易的命令叫做xkill。</p>
<p>简单的在终端中输入以下命令并在窗口中点击你想杀死的应用程序。</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">xkill</span></span><br></pre></td></tr></table></figure>
<p>那如果整个系统挂掉了怎么办呢？</p>
<p>按住键盘上的‘alt’和‘sysrq’不放，然后慢慢输入以下键：</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">REISUB</span></span><br></pre></td></tr></table></figure>
<p>这样不按电源键你的计算机也能重启了。</p>
</li>
<li><p>下载Youtube视频</p>
<p>一般来说我们大多数人都喜欢看Youtube的视频，也会通过钟爱的播放器播放Youtube的流媒体。</p>
<p>如果你需要离线一段时间（比如：从苏格兰南部坐飞机到英格兰南部旅游的这段时间）那么你可能希望下载一些视频到存储设备中，到闲暇时观看。</p>
<p>你所要做的就是从包管理器中安装youtube-dl。</p>
<p>你可以用以下命令使用youtube-dl：</p>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">youtube-<span class="keyword">dl</span> url-<span class="keyword">to</span>-video</span><br></pre></td></tr></table></figure>
<p>你可以在Youtubu视频页面点击分享链接得到视频的url。只要简单的复制链接在粘帖到命令行就行了（要用shift + insert快捷键哟）。</p>
</li>
</ol>
<p>总结，希望你在这篇文章中得到帮助，并且在这11条中找到至少一条让你惊叹“原来可以这样”的技巧。</p>
<p>reference:</p>
<ul>
<li><a href="https://linux.cn/article-5438-1.html" target="_blank" rel="noopener">11个让你吃惊的 Linux 终端命令</a></li>
<li><a href="https://www.lifewire.com/linux-terminal-commands-rock-your-world-2201165" target="_blank" rel="noopener">15 Linux Terminal Commands That Will Rock Your World</a></li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/17/vsftp-config-analysis/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/17/vsftp-config-analysis/" class="post-title-link" itemprop="url">[转] vsftpd 配置文件详解</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-17 22:11:16 22:11:16" itemprop="dateModified" datetime="2015-05-17T22:11:16+08:00">2015-05-17 22:11:16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index">
                    <span itemprop="name">Linux</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/17/vsftp-config-analysis/" class="post-meta-item leancloud_visitors" data-flag-title="[转] vsftpd 配置文件详解" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <ol>
<li><p>默认配置：<br>允许匿名用户和本地用户登陆</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anonymous_enable</span>=<span class="literal">YES</span></span><br><span class="line"><span class="attr">local_enable</span>=<span class="literal">YES</span></span><br></pre></td></tr></table></figure>
<p>匿名用户使用的登陆名为ftp或anonymous，口令为空；匿名用户不能离开匿名用户家目录/var/ftp,且只能下载不能上传。<br>本地用户的登录名为本地用户名，口令为此本地用户的口令；本地用户可以在自 己家目录中进行读写操作；本地用户可以离开自家目录切换至有权限访问的其他目录，并在权限允许的情况下进行上传/下载。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">write_enable</span>=<span class="literal">YES</span></span><br></pre></td></tr></table></figure>
<p>写在文件/etc/vsftpd.ftpusers中的本地用户禁止登陆。</p>
</li>
<li><p>配置文件格式：<br>vsftpd.conf 的内容非常单纯，每一行即为一项设定。若是空白行或是开头为#的一行，将会被忽略。内容的格式只有一种，如下所示</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">option</span>=value</span><br></pre></td></tr></table></figure>
<p>要注意的是，<code>等号两边不能加空白</code>。</p>
</li>
<li><p>匿名用户（anonymous）设置</p>
<p>控制是否允许匿名用户登入，YES 为允许匿名登入，NO 为不允许。默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anonymous_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>
<p>是否允许登陆用户有写权限。属于全局设置，默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">write_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>若是启动这项功能，则使用匿名登入时，不会询问密码。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">no_anon_password</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>定义匿名登入的使用者名称。默认值为ftp。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ftp_username</span>=ftp</span><br></pre></td></tr></table></figure>

<p>使用匿名登入时，所登入的目录。默认值为/var/ftp。注意ftp目录不能是777的权限属性，即匿名用户的家目录不能有777的权限。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_root</span>=/var/ftp</span><br></pre></td></tr></table></figure>

<p>如果设为YES，则允许匿名登入者有上传文件（非目录）的权限，只有在write_enable=YES时，此项才有效。当然，匿名用户必须要有对上层目录的写入权。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_upload_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>如果设为YES，则允许匿名登入者下载可阅读的档案（可以下载到本机阅读，不能直接在FTP服务器中打开阅读）。默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_world_readable_only</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>如果设为YES，则允许匿名登入者有新增目录的权限，只有在write_enable=YES时，此项才有效。当然，匿名用户必须要有对上层目录的写入权。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_mkdir_write_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>如果设为YES，则允许匿名登入者更多于上传或者建立目录之外的权限，譬如删除或者重命名。（如果anon_upload_enable=NO，则匿名用户不能上传文件，但可以删除或者重命名已经存在的文件；如果<code>anon_mkdir_write_enable=NO</code>，则匿名用户不能上传或者新建文件夹，但可以删除或者重命名已经存在的文件夹。）默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_other_write_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>设置是否改变匿名用户上传文件（非目录）的属主。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">chown_uploads</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>设置匿名用户上传文件（非目录）的属主名。建议不要设置为root。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">chown_username</span>=username</span><br></pre></td></tr></table></figure>

<p>设置匿名登入者新增或上传档案时的umask 值。默认值为077，则新建档案的对应权限为700。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_umask</span>=<span class="number">077</span></span><br></pre></td></tr></table></figure>

<p>若是启动这项功能，则必须提供一个档案<code>/etc/vsftpd/banner_emails</code>，内容为email address。若是使用匿名登入，则会要求输入email address，若输入的email address 在此档案内，则不允许进入。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deny_email_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>此文件用来输入email address，只有在deny_email_enable=YES时，才会使用到此档案。若是使用匿名登入，则会要求输入email address，若输入的email address 在此档案内，则不允许进入。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">banned_email_file</span>=/etc/vsftpd/banner_emails</span><br></pre></td></tr></table></figure>
</li>
<li><p>本地用户设置</p>
<p>控制是否允许本地用户登入，YES 为允许本地用户登入，NO为不允许。默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">local_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>当本地用户登入时，将被更换到定义的目录下。默认值为各用户的家目录。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">local_root</span>=/home/username</span><br></pre></td></tr></table></figure>

<p>是否允许登陆用户有写权限。属于全局设置，默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">write_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>本地用户新增档案时的umask 值。默认值为077。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">local_umask</span>=<span class="number">022</span></span><br></pre></td></tr></table></figure>

<p>本地用户上传档案后的档案权限，与chmod 所使用的数值相同。默认值为0666。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">file_open_mode</span>=<span class="number">0755</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>欢迎语设置</p>
<p>如果启动这个选项，那么使用者第一次进入一个目录时，会检查该目录下是否有.message这个档案，如果有，则会出现此档案的内容，通常这个档案会放置欢迎话语，或是对该目录的说明。默认值为开启。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">dirmessage_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>设置目录消息文件，可将要显示的信息写入该文件。默认值为.message。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">message_file</span>=.message</span><br></pre></td></tr></table></figure>

<p>当使用者登入时，会显示此设定所在的档案内容，通常为欢迎话语或是说明。默认值为无。如果欢迎信息较多，则使用该配置项。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">banner_file</span>=/etc/vsftpd/banner</span><br></pre></td></tr></table></figure>

<p>这里用来定义欢迎话语的字符串，banner_file是档案的形式，而ftpd_banner 则是字符串的形式。预设为无。</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">ftpd_banner</span>=Welcome <span class="keyword">to</span> BOB<span class="string">'s FTP server</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>控制用户是否允许切换到上级目录</p>
<p>在默认配置下，本地用户登入FTP后可以使用cd命令切换到其他目录，这样会对系统带来安全隐患。可以通过以下三条配置文件来控制用户切换目录。</p>
<p>设置是否启用chroot_list_file配置项指定的用户列表文件。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">chroot_list_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>用于指定用户列表文件，该文件用于控制哪些用户可以切换到用户家目录的上级目录。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">chroot_list_file</span>=/etc/vsftpd.chroot_list</span><br></pre></td></tr></table></figure>

<p>用于指定用户列表文件中的用户是否允许切换到上级目录。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">chroot_local_user</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>通过搭配能实现以下几种效果：</p>
<ul>
<li>当chroot_list_enable=YES，chroot_local_user=YES时，在/etc/vsftpd.chroot_list文件中列出的用户，可以切换到其他目录；未在文件中列出的用户，不能切换到其他目录。</li>
<li>当chroot_list_enable=YES，chroot_local_user=NO时，在/etc/vsftpd.chroot_list文件中列出的用户，不能切换到其他目录；未在文件中列出的用户，可以切换到其他目录。</li>
<li>当chroot_list_enable=NO，chroot_local_user=YES时，所有的用户均不能切换到其他目录。</li>
<li>当chroot_list_enable=NO，chroot_local_user=NO时，所有的用户均可以切换到其他目录。</li>
</ul>
</li>
<li><p>数据传输模式设置<br>FTP在传输数据时，可以使用二进制方式，也可以使用ASCII模式来上传或下载数据。</p>
<p>设置是否启用ASCII 模式上传数据。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ascii_upload_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>设置是否启用ASCII 模式下载数据。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ascii_download_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>
</li>
<li><p>访问控制设置</p>
<p>两种控制方式：一种控制主机访问，另一种控制用户访问。</p>
<ul>
<li><p>控制主机访问：</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">tcp_wrappers</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>
<p>设置vsftpd是否与tcp wrapper相结合来进行主机的访问控制。默认值为YES。如果启用，则vsftpd服务器会检查/etc/hosts.allow 和/etc/hosts.deny 中的设置，来决定请求连接的主机，是否允许访问该FTP服务器。这两个文件可以起到简易的防火墙功能。<br>比如：若要仅允许192.168.0.1—192.168.0.254的用户可以连接FTP服务器，则在/etc/hosts.allow文件中添加以下内容：</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">vsftpd</span><span class="selector-pseudo">:192.168.0.</span> <span class="selector-pseudo">:allow</span></span><br><span class="line"><span class="selector-tag">all</span><span class="selector-pseudo">:all</span> <span class="selector-pseudo">:deny</span></span><br></pre></td></tr></table></figure></li>
<li><p>控制用户访问：</p>
<p>对于用户的访问控制可以通过/etc目录下的vsftpd.user_list和ftpusers文件来实现。</p>
<p>控制用户访问FTP的文件，里面写着用户名称。一个用户名称一行。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">userlist_file</span>=/etc/vsftpd.user_list</span><br></pre></td></tr></table></figure>

<p>是否启用vsftpd.user_list文件。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">userlist_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>决定vsftpd.user_list文件中的用户是否能够访问FTP服务器。若设置为YES，则vsftpd.user_list文件中的用户不允许访问FTP，若设置为NO，则只有vsftpd.user_list文件中的用户才能访问FTP。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">userlist_deny</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>/etc/vsftpd/ftpusers文件专门用于定义不允许访问FTP服务器的用户列表（注意:如果userlist_enable=YES,userlist_deny=NO,此时如果在vsftpd.user_list和ftpusers中都有某个用户时，那么这个用户是不能够访问FTP的，即ftpusers的优先级要高）。</p>
<p>默认情况下vsftpd.user_list和ftpusers，这两个文件已经预设置了一些不允许访问FTP服务器的系统内部账户。如果系统没有这两个文件，那么新建这两个文件，将用户添加进去即可。</p>
</li>
</ul>
</li>
<li><p>访问速率设置</p>
<p>设置匿名登入者使用的最大传输速度，单位为B/s，0 表示不限制速度。默认值为0。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">anon_max_rate</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>

<p>本地用户使用的最大传输速度，单位为B/s，0 表示不限制速度。预设值为0。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">local_max_rate</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>超时时间设置</p>
<p>设置建立FTP连接的超时时间，单位为秒。默认值为60。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">accept_timeout</span>=<span class="number">60</span></span><br></pre></td></tr></table></figure>

<p>PORT 方式下建立数据连接的超时时间，单位为秒。默认值为60。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">connect_timeout</span>=<span class="number">60</span></span><br></pre></td></tr></table></figure>

<p>设置建立FTP数据连接的超时时间，单位为秒。默认值为120。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">data_connection_timeout</span>=<span class="number">120</span></span><br></pre></td></tr></table></figure>

<p>设置多长时间不对FTP服务器进行任何操作，则断开该FTP连接，单位为秒。默认值为300 。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">idle_session_timeout</span>=<span class="number">300</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>日志文件设置</p>
<p>是否启用上传/下载日志记录。如果启用，则上传与下载的信息将被完整纪录在xferlog_file 所定义的档案中。预设为开启。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">xferlog_enable</span>= <span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>设置日志文件名和路径，默认值为/var/log/vsftpd.log。</p>
<figure class="highlight lasso"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">xferlog_file=/<span class="built_in">var</span>/<span class="keyword">log</span>/vsftpd.<span class="keyword">log</span></span><br></pre></td></tr></table></figure>
<p>如果启用，则日志文件将会写成xferlog的标准格式，如同wu-ftpd 一般。默认值为关闭。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">xferlog_std_format</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>如果启用此选项，所有的FTP请求和响应都会被记录到日志中，默认日志文件在/var/log/vsftpd.log。启用此选项时，xferlog_std_format不能被激活。这个选项有助于调试。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">log_ftp_protocol</span>=<span class="literal">YES</span>|<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>
</li>
<li><p>定义用户配置文件</p>
<p>在vsftpd中，可以通过定义用户配置文件来实现不同的用户使用不同的配置。</p>
<p>设置用户配置文件所在的目录。当设置了该配置项后，用户登陆服务器后，系统就会到/etc/vsftpd/userconf目录下，读取与当前用户名相同的文件，并根据文件中的配置命令，对当前用户进行更进一步的配置。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">user_config_dir</span>=/etc/vsftpd/userconf</span><br></pre></td></tr></table></figure>

<p>例如：</p>
<p>定义user_config_dir=/etc/vsftpd/userconf，且主机上有使用者 test1,test2，那么我们就在user_config_dir 的目录新增文件名为test1和test2两个文件。若是test1 登入，则会读取user_config_dir 下的test1 这个档案内的设定。默认值为无。利用用户配置文件，可以实现对不同用户进行访问速度的控制，在各用户配置文件中定义local_max_rate=XX，即可。</p>
</li>
<li><p>FTP的工作方式与端口设置</p>
<p>FTP有两种工作方式：PORT FTP（主动模式）和PASV FTP（被动模式）</p>
<p>设置FTP服务器建立连接所监听的端口，默认值为21。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">listen_port</span>=<span class="number">21</span></span><br></pre></td></tr></table></figure>

<p>指定FTP使用20端口进行数据传输，默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">connect_from_port_20</span>=<span class="literal">YES</span>/<span class="literal">NO</span></span><br></pre></td></tr></table></figure>

<p>设置在PORT方式下，FTP数据连接使用的端口，默认值为20。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ftp_data_port</span>=<span class="number">20</span></span><br></pre></td></tr></table></figure>

<p>若设置为YES，则使用PASV工作模式；若设置为NO，则使用PORT模式。默认值为YES，即使用PASV工作模式。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">pasv_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>在PASV工作模式下，数据连接可以使用的端口范围的最大端口，0 表示任意端口。默认值为0。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">pasv_max_port</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>

<p>在PASV工作模式下，数据连接可以使用的端口范围的最小端口，0 表示任意端口。默认值为0。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">pasv_min_port</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>与连接相关的设置</p>
<p>设置vsftpd服务器是否以standalone模式运行。以standalone模式运行是一种较好的方式，此时listen必须设置为YES，此为默认值。建议不要更改，有很多与服务器运行相关的配置命令，需要在此模式下才有效。若设置为NO，则vsftpd不是以独立的服务运行，要受到xinetd服务的管控，功能上会受到限制。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">listen</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>

<p>设置vsftpd允许的最大连接数，默认值为0，表示不受限制。若设置为100时，则同时允许有100个连接，超出的将被拒绝。只有在standalone模式运行才有效。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">max_clients</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>

<p>设置每个IP允许与FTP服务器同时建立连接的数目。默认值为0，表示不受限制。只有在standalone模式运行才有效。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">max_per_ip</span>=<span class="number">0</span></span><br></pre></td></tr></table></figure>

<p>设置FTP服务器在指定的IP地址上侦听用户的FTP请求。若不设置，则对服务器绑定的所有IP地址进行侦听。只有在standalone模式运行才有效。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">listen_address</span>=IP地址</span><br></pre></td></tr></table></figure>

<p>设置每个与FTP服务器的连接，是否以不同的进程表现出来。默认值为NO，此时使用ps aux |grep ftp只会有一个vsftpd的进程。若设置为YES，则每个连接都会有一个vsftpd的进程。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">setproctitle_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>
</li>
<li><p>虚拟用户设置</p>
<p>虚拟用户使用PAM认证方式</p>
<p>设置PAM使用的名称，默认值为/etc/pam.d/vsftpd。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">pam_service_name</span>=vsftpd</span><br></pre></td></tr></table></figure>

<p>启用虚拟用户。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">guest_enable</span>= <span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>这里用来映射虚拟用户。默认值为ftp。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">guest_username</span>=ftp</span><br></pre></td></tr></table></figure>

<p>当该参数激活（YES）时，虚拟用户使用与本地用户相同的权限。当此参数关闭（NO）时，虚拟用户使用与匿名用户相同的权限。默认情况下此参数是关闭的（NO）。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">virtual_use_local_privs</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>
</li>
<li><p>其他设置</p>
<p>设置在执行ls –la之类的命令时，是显示UID、GID还是显示出具体的用户名和组名。默认值为NO，即以UID和GID方式显示。若希望显示用户名和组名，则设置为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">text_userdb_names</span>= <span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>若是启用此功能，则允许登入者使用ls –R（可以查看当前目录下子目录中的文件）这个指令。默认值为NO。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">ls_recurse_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>如果启用此功能，所有档案的拥有者与群组都为ftp，也就是使用者登入使用ls -al之类的指令，所看到的档案拥有者跟群组均为ftp。默认值为关闭。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">hide_ids</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">NO</span>）</span><br></pre></td></tr></table></figure>

<p>如果设置为NO，所有的文件都不能下载到本地，文件夹不受影响。默认值为YES。</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">download_enable</span>=<span class="literal">YES</span>/<span class="literal">NO</span>（<span class="literal">YES</span>）</span><br></pre></td></tr></table></figure>
</li>
</ol>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/08/mysql-update-table-not-exit/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/08/mysql-update-table-not-exit/" class="post-title-link" itemprop="url">ERROR 1146 (42S02)/1146 mysql table doesn't exist</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-08 22:23:46 22:23:46" itemprop="dateModified" datetime="2015-05-08T22:23:46+08:00">2015-05-08 22:23:46</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/MySQL/" itemprop="url" rel="index">
                    <span itemprop="name">MySQL</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/08/mysql-update-table-not-exit/" class="post-meta-item leancloud_visitors" data-flag-title="ERROR 1146 (42S02)/1146 mysql table doesn't exist" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>背景：mysql data目录迁移。laudukang，2017年11月20日14:02:28。</p>
<p>首先在自己的mysql下，建立一个你即将要拷贝的数据库（数据库名要一样，里面不需要建表），</p>
<p>然后将所有的.frm文件拷贝到你建的数据库文件夹下，此时再次进入mysql，用show tables查看表是否已经建立起来了，</p>
<p>然后停止你自己的mysql服务，发现在data文件下面已经有ib_logfile0、ib_logfile1和ibdata1三个文件了（免安装版解压后是没有的），</p>
<p>之后停掉别人的mysql服务，只将ibdata1文件拷贝过来进行覆盖，最后启动你自己的mysql服务就可以对数据库进行正常操作了。</p>
<p>referene:</p>
<ul>
<li><a href="http://jazka.blog.51cto.com/809003/330418/" target="_blank" rel="noopener">Mysql数据库的使用总结之ERROR 1146 (42S02)</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-fix-privilege-tables.html" target="_blank" rel="noopener">4.4.4 mysql_fix_privilege_tables — Upgrade MySQL System Tables</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html" target="_blank" rel="noopener">4.4.8 mysql_upgrade — Check and Upgrade MySQL Tables</a></li>
<li><a href="http://blog.itpub.net/15480802/viewspace-1412259/" target="_blank" rel="noopener">mysql升级小结和mysql_upgrade的用途</a></li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/06/warnning-hidden-information-in-resume-template/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/06/warnning-hidden-information-in-resume-template/" class="post-title-link" itemprop="url">记一次简历模板中的隐藏信息</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-06 21:52:17 21:52:17" itemprop="dateModified" datetime="2015-05-06T21:52:17+08:00">2015-05-06 21:52:17</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/uncategorized/" itemprop="url" rel="index">
                    <span itemprop="name">uncategorized</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/06/warnning-hidden-information-in-resume-template/" class="post-meta-item leancloud_visitors" data-flag-title="记一次简历模板中的隐藏信息" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          Hidden information in resume template
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2015/05/06/warnning-hidden-information-in-resume-template/">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://codz-me.vercel.app/2015/05/04/mysql-user-and-permission-management/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head.png">
      <meta itemprop="name" content="laudukang">
      <meta itemprop="description" content="Bug Not Found">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Code Is Poetry">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2015/05/04/mysql-user-and-permission-management/" class="post-title-link" itemprop="url">MySQL用户和权限管理</a>
        </h1>

        <div class="post-meta">
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2015-05-04 21:17:10 21:17:10" itemprop="dateModified" datetime="2015-05-04T21:17:10+08:00">2015-05-04 21:17:10</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/MySQL/" itemprop="url" rel="index">
                    <span itemprop="name">MySQL</span>
                  </a>
                </span>
            </span>

          
            <span id="/2015/05/04/mysql-user-and-permission-management/" class="post-meta-item leancloud_visitors" data-flag-title="MySQL用户和权限管理" title="阅读次数">
                <span hidden class="leancloud-visitors-count"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>(原文内容渲染后较为凌乱，不再整理，保留refer，laudukang，2017年11月19日23:45:43)</p>
<p>reference:</p>
<ul>
<li><a href="http://www.toxingwang.com/database/mysql/1468.html" target="_blank" rel="noopener">MySQL用户和权限管理</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#privilege-changes" target="_blank" rel="noopener">http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#privilege-changes</a></li>
</ul>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

  </div>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/5/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" href="/page/7/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="laudukang"
      src="/images/head.png">
  <p class="site-author-name" itemprop="name">laudukang</p>
  <div class="site-description" itemprop="description">Bug Not Found</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">68</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">10</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/laudukang" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;laudukang" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://gitee.com/laudukang" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;laudukang" rel="noopener" target="_blank"><i class="fa fa-fw fa-github-alt"></i>Gitee</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/users/5621049/laudukang" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;users&#x2F;5621049&#x2F;laudukang" rel="noopener" target="_blank"><i class="fa fa-fw fa-stack-overflow"></i>StackOverflow</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.google.com/maps/place/%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%BD%AF%E4%BB%B6%E4%BA%A7%E4%B8%9A%E5%9F%BA%E5%9C%B0/@22.5244896,113.9382973,17z/data=!3m1!4b1!4m5!3m4!1s0x3403ee17d008a019:0xbb7b06b73d856c14!8m2!3d22.5244896!4d113.9382973" title="Map → https:&#x2F;&#x2F;www.google.com&#x2F;maps&#x2F;place&#x2F;%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%BD%AF%E4%BB%B6%E4%BA%A7%E4%B8%9A%E5%9F%BA%E5%9C%B0&#x2F;@22.5244896,113.9382973,17z&#x2F;data&#x3D;!3m1!4b1!4m5!3m4!1s0x3403ee17d008a019:0xbb7b06b73d856c14!8m2!3d22.5244896!4d113.9382973" rel="noopener" target="_blank"><i class="fa fa-fw fa-map-marker"></i>Map</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 2015 – 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-heart icon-next-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">laudukang</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> v7.7.1
  </div>

        
<div class="busuanzi-count">
  <script pjax async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</div>






  <script pjax>
  function leancloudSelector(url) {
    url = encodeURI(url);
    return document.getElementById(url).querySelector('.leancloud-visitors-count');
  }
  if (CONFIG.page.isPost) {
    function addCount(Counter) {
      var visitors = document.querySelector('.leancloud_visitors');
      var url = decodeURI(visitors.getAttribute('id'));
      var title = visitors.getAttribute('data-flag-title');

      Counter('get', `/classes/Counter?where=${JSON.stringify({ url })}`)
        .then(response => response.json())
        .then(({ results }) => {
          if (results.length > 0) {
            var counter = results[0];
              leancloudSelector(url).innerText = counter.time + 1;
            Counter('put', '/classes/Counter/' + counter.objectId, { time: { '__op': 'Increment', 'amount': 1 } })
              .then(response => response.json())
              .catch(error => {
                console.error('Failed to save visitor count', error);
              })
          } else {
              Counter('post', '/classes/Counter', { title: title, url: url, time: 1 })
                .then(response => response.json())
                .then(() => {
                  leancloudSelector(url).innerText = 1;
                })
                .catch(error => {
                  console.error('Failed to create', error);
                });
          }
        })
        .catch(error => {
          console.error('LeanCloud Counter Error', error);
        });
    }
  } else {
    function showTime(Counter) {
      var visitors = document.querySelectorAll('.leancloud_visitors');
      var entries = [...visitors].map(element => {
        return decodeURI(element.getAttribute('id'));
      });

      Counter('get', `/classes/Counter?where=${JSON.stringify({ url: { '$in': entries } })}`)
        .then(response => response.json())
        .then(({ results }) => {
          if (results.length === 0) {
            document.querySelectorAll('.leancloud_visitors .leancloud-visitors-count').forEach(element => {
              element.innerText = 0;
            });
            return;
          }
          for (let item of results) {
            let { url, time } = item;
            leancloudSelector(url).innerText = time;
          }
          for (let url of entries) {
            var element = leancloudSelector(url);
            if (element.innerText == '') {
              element.innerText = 0;
            }
          }
        })
        .catch(error => {
          console.error('LeanCloud Counter Error', error);
        });
    }
  }

  fetch('https://app-router.leancloud.cn/2/route?appId=CPfRDhOlTyfkHW155W3Kx3H1-gzGzoHsz')
    .then(response => response.json())
    .then(({ api_server }) => {
      var Counter = (method, url, data) => {
        return fetch(`https://${api_server}/1.1${url}`, {
          method: method,
          headers: {
            'X-LC-Id': 'CPfRDhOlTyfkHW155W3Kx3H1-gzGzoHsz',
            'X-LC-Key': 'TX05RQSQMd8fbL7RaJNADS7S',
            'Content-Type': 'application/json',
          },
          body: JSON.stringify(data)
        });
      };
      if (CONFIG.page.isPost) {
        if (CONFIG.hostname !== location.hostname) return;
        addCount(Counter);
      } else if (document.querySelectorAll('.post-title-link').length >= 1) {
        showTime(Counter);
      }
    });
  </script>


      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/pjax/pjax.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>

  <script>
var pjax = new Pjax({
  selectors: [
    'head title',
    '#page-configurations',
    '.content-wrap',
    '.post-toc-wrap',
    '#pjax'
  ],
  switches: {
    '.post-toc-wrap': Pjax.switches.innerHTML
  },
  analytics: false,
  cacheBust: false,
  scrollTo : !CONFIG.bookmark.enable
});

window.addEventListener('pjax:success', () => {
  document.querySelectorAll('script[pjax], script#page-configurations, #pjax script').forEach(element => {
    var code = element.text || element.textContent || element.innerHTML || '';
    var parent = element.parentNode;
    parent.removeChild(element);
    var script = document.createElement('script');
    if (element.id) {
      script.id = element.id;
    }
    if (element.className) {
      script.className = element.className;
    }
    if (element.type) {
      script.type = element.type;
    }
    if (element.src) {
      script.src = element.src;
      // Force synchronous loading of peripheral JS.
      script.async = false;
    }
    if (element.getAttribute('pjax') !== null) {
      script.setAttribute('pjax', '');
    }
    if (code !== '') {
      script.appendChild(document.createTextNode(code));
    }
    parent.appendChild(script);
  });
  NexT.boot.refresh();
  // Define Motion Sequence & Bootstrap Motion.
  if (CONFIG.motion.enable) {
    NexT.motion.integrator
      .init()
      .add(NexT.motion.middleWares.subMenu)
      .add(NexT.motion.middleWares.postList)
      .bootstrap();
  }
  NexT.utils.updateSidebarPosition();
});
</script>




  















    <div id="pjax">
  

  
<script>window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };</script><script defer src="/_vercel/insights/script.js" data-endpoint="/this-is-vercel-insights"></script><script>window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };</script><script defer src="/_vercel/speed-insights/script.js" data-endpoint="/this-is-vercel-insights-speed"></script>
    </div>
</body>
</html>
